Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Ensure necessary namespaces are in patched doc #2698

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

joshkel
Copy link

@joshkel joshkel commented Jul 3, 2024

Word for the web, for example, may generate .docx files with a very limited set of XML namespaces:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">

Using one of these files as the template / source for a docx.js patch may result in errors from missing namespaces.

To fix this, I added the handful of namespaces that appear to be needed by docx.js's elements. It may be better to include the full set of namespaces from the Document class. If you'd prefer I do that, please let me know.

I did some refactoring to simplify this and to cut down on duplicate namespace references. If you'd prefer I handle this differently, please let me know.

Fixes #2697

@dolanmiu
Copy link
Owner

Seems good, need to make the CI to start. Unsure why it isn't starting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Word experienced an error" from missing xmlns
2 participants